package roboSoccer;

/**
 * Abstract class for a team behavior. A team behavior acts as a goal for the
 * team as a whole. The class assigns roles to each of the robots individually:
 * assigning them their PlayerBehavior.
 * 
 * @author URCSrobots
 * 
 */
public abstract class TeamBehavior {

	/**
	 * All behaviors should have a distinct name.
	 */
	public String name;

	/**
	 * The superclass constructor just needs to store the name.
	 * 
	 * @param name
	 *            The name of the behavior.
	 */
	public TeamBehavior(String name) {
		this.name = name;
	}
	
	/**
	 * Used to copy the behavior from the behavior list that a team owns to begin a new behavior.
	 * @return  The copy of the behavior.
	 */
	public abstract TeamBehavior copy();

	/**
	 * This is called every loop in order to give roles to our robots.
	 * 
	 * @param game
	 *            The current physical state of the game.
	 * @param team
	 *            A reference to the team implementing this behavior.
	 */
	public abstract void update(GameState game, RoboTeam team);

	/**
	 * Evaluates the value of performing this behavior given the current game
	 * state.
	 * 
	 * @param game
	 *            The current game state.
	 * @param team
	 *            A reference to the team implementing this behavior.
	 */
	public abstract int behaviorValue(GameState game, RoboTeam team);

	public String toString() {
		return name;
	}
}
